<template>
    <div id="app" v-loading="loading">
        <div class="title"><a class="backPage iconfont icon-icon-test" @click="$router.back(-1)"></a>系统模板详情</div>
        <el-form class="form" label-position="top">
            <el-row :gutter="40" class="other">
                <el-col :span="4">
                    <div class="grid-content bg-purple">
                        <el-form-item label="模板名称">
                            <div class="disbox">
                                <el-input class="disflex"
                                    v-model="linkConfig.name"
                                ></el-input>
                            </div>
                        </el-form-item>
                    </div>
                </el-col>
                <!-- <el-col :span="4">
                    <div class="grid-content bg-purple">
                        <el-form-item label="任务标题">
                            <div class="disbox">
                                <el-input class="disflex"
                                    v-model="linkConfig.title"
                                ></el-input>
                                <el-switch v-model="linkConfig.not_allow_edite_title" class="elSwitch"></el-switch>
                            </div>
                        </el-form-item>
                    </div>
                </el-col> -->
                <el-col :span="4">
                    <div class="grid-content bg-purple">
                    <el-form-item label="做任务限时,分钟">
                        <div class="disbox">
                            <el-input class="disflex"
                                v-model="linkConfig.limited_time"
                            ></el-input>
                            <el-switch  v-model="linkConfig.limited_time_allow_edit" class="elSwitch"></el-switch>
                        </div>
                    </el-form-item>
                    </div>
                </el-col>
                <el-col :span="4">
                    <div class="grid-content bg-purple">
                        <el-form-item label="派单人审核时间,分钟">
                            <div class="disbox">
                                <el-input class="disflex"
                                    v-model="linkConfig.limited_time_approve"
                                ></el-input>
                                <el-switch v-model="linkConfig.limited_time_approve_allow_edit" class="elSwitch"></el-switch>
                            </div>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="4">
                    <div class="grid-content bg-purple">
                    <el-form-item label="任务截至过期,小时">
                        <div class="disbox">
                            <el-input class="disflex"
                                v-model="linkConfig.deadline_time"
                            ></el-input>
                            <el-switch v-model="linkConfig.deadline_time_allow_edit" class="elSwitch"></el-switch>
                        </div>
                    </el-form-item>
                    </div>
                </el-col>
                <el-col :span="4">
                    <div class="grid-content bg-purple">
                        <el-form-item label="可接设备">
                            <div class="disbox">
                                <el-checkbox-group v-model="linkConfig.limited_os" class="disflex"
                                    :min="1"
                                >
                                    <el-checkbox 
                                        v-for="osItem of osList" 
                                        :key="osItem.name"
                                        :label="osItem.value"
                                    >
                                    {{
                                        osItem.name
                                    }}
                                    </el-checkbox>
                                </el-checkbox-group>
                                <el-switch v-model="linkConfig.limited_os_allow_edit" class="elSwitch"></el-switch>
                            </div>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
        </el-form>
        <task-step mode="userTemplate" 
            :taskSteps="taskSteps"
            :uploadBids="uploadBids"
        />
        <el-button type="primary" :style="{'margin-top':'30px','margin-left':(taskSteps.length==0?'':'45px')}"
            @click="postSystemTeplateDetailApi"
        >立即保存</el-button>
    </div>
</template>

<script>
    import SystemTemplateDetail from './index.js';
    export default SystemTemplateDetail;
</script>
<style lang="scss" scoped>
    .form{
        margin-top:30px;
        border-top:1px solid #FFF;
    }
    .titles{
        margin-top:25px;
        margin-bottom:12px;
        font-size:19px;
    }
</style>